import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Regex 
{
	public static void main (String [] args)
	{
		String a = "('amir','alon')";
		Pattern pattern = Pattern.compile("\\('([^']*?)'.+'([^']*?)'\\)");
		Matcher matcher = pattern.matcher(a);
		while (matcher.find()) 
		{
			System.out.println(matcher.group(1));
		}
	}
}
